<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<aside class="col-lg-4">
    <!-- Widget [Search Bar Widget]-->
    <div class="widget search">
        <header>
            <h3 class="h6">搜索博客</h3>
        </header>
        <form action="${pageContext.request.contextPath}/index?method=search" class="search-form" method="post">
            <div class="form-group">
                <input type="search" placeholder="你要看点啥?" name="search">
                <button type="submit" class="submit"><i class="icon-search"></i></button>
            </div>
        </form>
    </div>
    <!-- Widget [Latest Posts Widget]        -->
    <div class="widget latest-posts">
        <header>
            <h3 class="h6">最新博客</h3>
        </header>
        <div class="blog-posts">
            <%--                    最新博客--%>
            <c:forEach items="${hotArticles}" var="hotArticle">
                <a href="${pageContext.request.contextPath}/index?method=get&id=${hotArticle.getId()}">
                    <div class="item d-flex align-items-center">
                        <div class="image"><img src="${hotArticle.getImage()}" alt="..." class="img-fluid">
                        </div>
                        <div class="title"><strong>${hotArticle.getTitle()}</strong>
                            <div class="d-flex align-items-center">
                                <div class="views"><i class="icon-eye"></i>${hotArticle.getNumber()}</div>
                                <div class="views"><i class="icon-comment"></i>${hotArticle.getVoteNumber()}</div>
                            </div>
                        </div>
                    </div>
                </a>
            </c:forEach>
        </div>
    </div>
    <!-- Widget [Categories Widget]-->
    <%--            种类--%>
    <div class="widget categories">
        <header>
            <h3 class="h6">博客种类</h3>
        </header>
        <c:forEach items="${types}" var="type">
            <div class="item d-flex justify-content-between"><a
                    href="${pageContext.request.contextPath}/index?method=checkType&typeid=${type.getId()}">${type.getTypeName()}</a><span>${type.getNumber()}</span>
            </div>
        </c:forEach>
    </div>
    <!-- Widget [Tags Cloud Widget]-->
    <%--            友链--%>
    <div class="widget tags">
        <header>
            <h3 class="h6">友情链接🔗</h3>
        </header>
        <ul class="list-inline">
            <c:forEach items="${links}" var="link">
                <li class="list-inline-item"><a href="${link.getUrl()}" class="tag">${link.getName()}</a></li>
            </c:forEach>

        </ul>
    </div>
</aside>
</body>
</html>
